package il.ac.biu.cs.grossmm.api.flow;

import il.ac.biu.cs.grossmm.api.data.Root;
import il.ac.biu.cs.grossmm.api.flow.Status;
import il.ac.biu.cs.grossmm.api.keys.Key;

public interface Subscription<N> {

	/**
	 * Closes the subscription: causes the notification provider to stop sending
	 * notifications for this subscription.
	 */
	void close();

	/**
	 * Gets the status of the subscription.
	 * 
	 * @return the status of the subscription
	 * 
	 * @see Status
	 */
	Status getStatus();

	/**
	 * Deactivates subscription and sets its state.
	 * 
	 * @param state
	 *            the status to set
	 */
	void deactivate(Status state);

	/**
	 * Activates subscription.
	 * 
	 * @param root
	 *            root of data tree associated with this subscription
	 */
	void activate(Root<N> root);

	Key getKey();

	/**
	 * Gets root node associated with this subscription
	 * 
	 * @return root node associated with this subscription
	 */
	Root<N> getRoot();

}